The typical computer system includes hardware (such as processor and memory) and software (such as the applications and operating systems) that execute on the hardware. An execution environment of the program corresponds to the hardware and software that execute with and affect the execution of the program. For example, the execution environment of a web browser includes the networking interfaces, operating system, and hardware.
In order for a program to operate in the execution environment defined by the computer system, the program is typically configured for the execution environment. Specifically, a developer of the program embeds a variety of configuration variables within the program. The configuration variables define how a program operates in the execution environment. The values for the configuration variables are based on the execution environment of the program, preferences of an individual installing and/or using the program, etc. The program can obtain the values for the configuration variables during execution of the program.
Some programs use a configuration file for holding the configuration values. The individual installing the program or the using the program can modify the configuration file to set the values for the configuration variables.
Typically, programs typically have multiple sources for obtaining the value for a configuration variable. For example, the configuration values may be set in a configuration file, as environmental variables, in a script, etc. During execution the program obtains the configuration values. Because multiple conflicting sources may exist for the values of a configuration variable, a single priority semantic is set for all configuration variables. A priority semantic specifies an ordering of the values of the configuration variables. If a value exists and has the highest priority, then the value is used for the configuration of the program.
The typical priority semantic is hierarchical. Specifically, the nearer a value is to the user of the program, the more priority exists for using the value. For example, a value set in the command line is given a higher priority than a default value. Accordingly, if a command line value exists, then the command line value is used regardless of whether the default value exists. Conversely, if a command line value does not exist, then the default value is used.